<?php

use Illuminate\Database\Seeder;

class ArticleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        //数据填充
        $data = [];
        for($i=0;$i<100;$i++){
        	$temp['title']=str_random(20);
        	$temp['content']=str_random(30);
        	$temp['descr']=str_random(30);
        	$temp['user_id']=rand(1,10);
        	$temp['cate_id']=rand(1,4);
        	$temp['pic']=str_random(20);
        	$temp['create_t']=date('Y-m-d H:i:s');
        	$data[]=$temp;
        }
        \DB::table('articles')->insert($data);
    }
}
